class Solution {
    public boolean CheckPermutation(String s1, String s2) {
        char[] hash = new char[26];
        char[] arr1 = s1.toCharArray();
        for (char c: arr1) {
            hash[c - 'a']++;
        }
        char[] arr2 = s2.toCharArray();
        for (char c: arr2) {
            hash[c - 'a']--;
        }
        for (int i: hash) {
            if (i != 0) return false;
        }

        return true;
    }
}